/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package models;

import java.io.Serializable;

/**
 * this class represents a friend in the database
 * @author gabrielle botbol
 */
public class Friends implements Serializable
{
    
    private String username;

    /**
     * Get the value of username
     *
     * @return the value of username
     */
    public String getUsername() 
    {
        return username;
    }
    
            private int idFriends;

    /**
     * Get the value of idFriends
     *
     * @return the value of idFriends
     */
    public int getIdFriends() 
    {
        return idFriends;
    }


    /**
     * constructs an instance of friends
     * @param idFriends
     * @param username 
     */
    public Friends(int idFriends, String username) 
    {
        this.idFriends = idFriends;
        this.username = username;
    }

    private Friends() 
    {
    }
    
    @Override
    public String toString()
    {
        return "id: "+this.getIdFriends()+" username: "+this.getUsername();
    }

    @Override
    public boolean equals(Object obj) 
    {
        if(obj instanceof Friends)
        {
            return this.hashCode()==obj.hashCode();
        }
        return false;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 59 * hash + (this.username != null ? this.username.hashCode() : 0);
        hash = 59 * hash + this.idFriends;
        return hash;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException 
    {
        Friends friend=new Friends(this.getIdFriends(),this.getUsername());
        return friend;
    }
    
    
}
